<?php

class Application_Permiso_ComentarioAssertion implements Zend_Acl_Assert_Interface 
{ 
    protected $_auth;
    
    public function __construct()
    {
        $this->_auth = Zend_Auth::getInstance();
    }
        
    public function assert(Zend_Acl $acl, 
                           Zend_Acl_Role_Interface $role = null, 
                           Zend_Acl_Resource_Interface $resource = null, 
                           $privilege = null) 
    { 
        $cliente = $this->_auth->getIdentity()->usuario;
        $creador_del_comentario = $resource->creador;
        if ($cliente == $creador_del_comentario){
            return TRUE;
        }
        return FALSE;
    } 
} 
